package com.csmp.action;

import java.util.List;

import com.bs.bean.RoleLog;
import com.csmp.service.RoleLogService;
import com.opensymphony.xwork2.ModelDriven;

public class RoleLogAction extends CommonAction implements ModelDriven<RoleLog> {

	private static final long serialVersionUID = 1L;
	private RoleLog log = new RoleLog();
	private RoleLogService service;

	public String search() throws Exception {
		try {
			int first = getPager().getOffset().intValue();
			int max = getPager().getMaxPageItems().intValue();
			int count = service.getCount(log);
			getPager().setItems(count);
			List<RoleLog> list = service.search(log, first, max);
			setDataList(list);
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			throw e;
		}
		return "logList";
	}

	public void setService(RoleLogService service) {
		this.service = service;
	}

	public RoleLog getModel() {
		return log;
	}

}
